#include <stdio.h>
#include <ctype.h>

#include <CompileVisitor.h>

#include "AstNodeBinaryOperator.h"


AstNodeBinaryOperator::AstNodeBinaryOperator(int op, AstNodeExpression * left, AstNodeExpression * rite)
{
  this->op=op;
  this->left=left;
  this->rite=rite;
}

void AstNodeBinaryOperator::compile(CompileVisitor * visitor)
{
  visitor->compile(this);
}

void AstNodeBinaryOperator::dump(int level)
{
  printf(" << ");
  left->dump(level+1);
  if(isprint(op)) printf(" %c ",op);
  rite->dump(level+1);
  printf(" >> ");
}
